The present invention relates to the execution of JAVA computer programs. Specifically, the present invention relates to a method and a system tailored for executing JAVA computer programs.
JAVA programs support multi-threaded execution that permits the construction and execution of multiple parallel paths inside a single program. The multi-threaded construct is a technique used to simplify the creation and implementation of complex programs. It does not, however, improve the performance of a JAVA program. The parallel paths do not execute in parallel (i.e., simultaneously). In fact, program execution becomes slower due to the overhead associated thread switching. Moreover, relative to complied programs such as C++ programs, a JAVA program is executed very slowly because it is typically interpreted.
In addition, a JAVA Virtual Machine (JVM) can run only a single JAVA application. If multiple JAVA applications are launched by a computer system, multiple JVM""s are instantiated, wherein each application runs inside its own JVM. Unless the host computer system is a multi-processor system (and most systems are not), none of the JAVA applications run simultaneously. Thus, on a single processor computer system, running multiple JAVA programs is severely burdened by having to run associated JVM""s. However, for a typical user, converting an existing single processor computer system to a multi-processor computer system is not a cost effective option. Moreover, even if a multi-processor computer system is available, a user still needs to figure out how to coordinate the multiple processors to execute multiple JAVA applications and their associated JVM""s.
Several prior art approaches exist for improving the performance of JAVA programs. These strategies include: the use of a native JAVA processor, and multi-processor execution of native JAVA threads.
The native JAVA processor is a specialized CPU whose machine instruction code is the un-interpreted JAVA Byte Code. This approach will certainly improve performance. However, this approach precludes compatibility with vast amounts of software that already exists for industry standard processors (e.g., X86, ARM, etc.).
The multi-processor native thread system is structured to execute native threads that a JAVA software program may call from inside the JVM. This is a very special and rare exception that provides performance improvement only when a JAVA program implements multiple threads executing non-JAVA code. This is too convoluted to be anything but a specialized case. As such, this system is not well suited for executing JAVA computer programs in general.
Thus, a need exists in general for improving the execution speed of a JAVA program. Specifically, a need exists for performing multi-threaded execution inside a single JAVA program while not suffering performance penalty due to thread switching. A further need exists for improving performance of JAVA programs while without becoming incompatible with existing software. An additional need exists for improving performance of JAVA programs while without relying on very limited and specialized approach. A need also exists for improving performance for running multiple JAVA programs while without having to replace a user""s existing computer system.
The present invention provides generally a method and a system for improving the execution speed of JAVA programs. Specifically, the present invention provides multi-threaded execution inside a single JAVA program while not suffering performance penalty due to thread switching. The present invention further provides improved performance of JAVA programs while being compatible with existing software. The present invention additionally provides improved performance for JAVA programs while without relying on specialized approach not applicable to JAVA programs in general. The present invention also provides improved performance for running multiple JAVA programs while without having to replace a user""s existing computer system.
In one embodiment of the present invention, an auxiliary system of multiple processors is coupled via a bus to a user""s host computer system for supporting the host computer system in executing the JAVA computer program. The auxiliary system includes multiple non-host processors coupled to a non-host memory. A non-host processor from these non-host processors is adapted to interface with a JAVA Virtual Machine (JVM) for executing one or more threads of the JAVA computer program. The JVM can be instantiated in the non-host memory. For executing a new thread, the JVM allocates an additional non-host processor for interfacing with the JVM to execute the new thread.
In the present embodiment, the auxiliary system need not be a permanent part of the host computer system. That is, the auxiliary system can be coupled to the host computer system as the need arises to run JAVA programs. Moreover, the auxiliary system can be detached from the host computer system if desired. However, optionally, the auxiliary system can be implemented as a permanent part of the host computer system, i.e., without being detachable from the host computer system.